package cn.tedu.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringRunner {
    public static void main(String[] args) {
        //1.加载Spring
        AnnotationConfigApplicationContext ac
                = new AnnotationConfigApplicationContext(SpringConfig.class);

        //2.从Spring中获取对象
        UserController userController = ac.getBean("userController",UserController.class);

        //3.测试使用对象,以便于观察是否获取到了有效对象
        userController.reg();

        //4.关闭
        ac.close();
    }
}
